import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/home/home'
import Intro from '@/pages/intro/intro'
import Hot from '@/pages/hot/hot'
import About from '@/pages/about/about'
import HotDetail from '@/pages/hot_detail/hot_detail'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      meta: {
        title: '首页'
      }
    },
    {
      path: '/intro',
      name: 'Intro',
      component: Intro,
      meta: {
        title: '平台介绍'
      }
    },
    {
      path: '/hot',
      name: 'Hot',
      component: Hot,
      meta: {
        title: '热门专业'
      }
    },
    {
      path: '/about',
      name: 'About',
      component: About,
      meta: {
        title: '关于我们'
      }
    },
    {
      path: '/hot_detail/:professionId',
      name: 'HotDetail',
      component: HotDetail,
      meta: {
        title: '详情'
      }
    }
  ],
  scrollBehavior (to, from, savedPosition) {
    // return 期望滚动到哪个的位置
    return {x: 0, y: 0}
  }
})
